//WdgScale.cpp
/*    widgetpp - A simple C++ wrapper of DISLIN graphic library               */
/*                                                                            */
/*    Copyright (C) 2012  Mirko Cambi (email: mirko.cambi@gmail.com)          */
/*                                                                            */
/*    This program is free software: you can redistribute it and/or modify    */
/*    it under the terms of the GNU General Public License as published by    */
/*    the Free Software Foundation, either version 3 of the License, or       */
/*    (at your option) any later version.                                     */
/*                                                                            */
/*    This program is distributed in the hope that it will be useful,         */
/*    but WITHOUT ANY WARRANTY; without even the implied warranty of          */
/*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           */
/*    GNU General Public License for more details.                            */
/*                                                                            */
/*    You should have received a copy of the GNU General Public License       */
/*    along with this program.  If not, see <http://www.gnu.org/licenses/>.   */

#include "WdgScale.hpp"
#include "dislin.h"

using namespace wdgpp;

WdgScale::WdgScale(const std::string &lab, float min, float max, float val, int nd): _lab(lab), _min(min), _max(max), _val(val), _nd(nd)
{
}

void WdgScale::set_value(float val)
{
   swgscl(get_id(), _val = val);
}

float WdgScale::get_value() const
{
   return gwgscl(get_id());
}

int WdgScale::create(int ip)
{
   return wgscl(ip, _lab.c_str(), _min, _max, _val, _nd);
}

